import { CommonProps, Properties } from '../common/CommonProps';
import { IGaeaSetting } from '../../defines/application';
import { PermissionFields } from '../../types';

declare type DateMode = 'year' | 'month' | 'date' | 'time'; // 统一的 在pc的组件内需要进行抓换
export type PCDateMode = 'year' | 'month' | 'date' | 'time';

export class Props extends CommonProps {
  public editSetting: IGaeaSetting = {
    key: 'gaea-datepicker',
    name: 'DatePicker',
    type: 'date',
    grouping: 'dateType',
    editors: [
      ...Properties,
      {
        field: 'mode',
        text: 'DateMode',
        type: 'select',
        data: [
          // {
          //   text: '年',
          //   value: 'year',
          // },
          // {
          //   text: '年-月',
          //   value: 'month',
          // },
          {
            text: '年-月-日',
            value: 'date'
          },
          {
            text: '年-月-日 时:分',
            value: 'time'
          }
        ]
      },
      {
        field: 'placeholder',
        text: 'Placeholder',
        type: 'string'
      }
    ]
  };

  public placeholder = '请选择'; // 控件提示语
  public mode?: DateMode = 'date';
  public validator?: any;
  public minDate?: string;
  public maxDate?: string;
  public permission?: PermissionFields;
  public readonly?: any;
  public initValue?: Date | undefined
}

export class State {
  showModal: boolean | any;
  value: Date | undefined;
  pickerValue: Date | undefined;
  public visibleConditions?: any;
}
